<template>
  <div class="list-item">
    <div class="list-item-content">
      <div class="left-box">
        <slot name="icon"></slot>
        <span>{{leftText}}</span>
      </div>
      <div>
        <slot name="middle"></slot>
      </div>
      <div>
        <span :style="{ color: righColor }">{{rightText}}</span>
        <span class="right-arrow" v-if="hasRightArrow"></span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    leftText: { // 左边文字
      type: String,
      default: ''
    },
    rightText: { // 右边文字
      type: String,
      default: ''
    },
    righColor: {
      type: String,
      default: '#000'
    },
    hasRightArrow: { // 是否显示向右箭头
      type: Boolean,
      default: true
    }
  }
}
</script>

<style scoped lang="scss">
.list-item {
  width: 100%;
  height: 1.15rem;
  line-height: 1.15rem;
  background-color: #fff;
  .list-item-content {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #e5e5e5;
    .left-box {
      display: flex;
      align-items: center;
    }
    img {
      display: inline-block;
      width: 0.4rem;
      height: auto;
      vertical-align: middle;
      margin-right: 0.15rem;
    }
    span {
      font-size: 0.3rem;
      color: rgba(15, 23, 43, 1);
    }
  }
  .right-arrow {
    display: inline-block;
    width: 0.14rem;
    height: 0.14rem;
    border-top: 1px solid #a9abb3;
    border-left: 1px solid #a9abb3;
    transform: rotate(135deg);
    vertical-align: middle;
    margin-left: 0.24rem;
  }
}
</style>
